package com.ruoyi.service.jpjs.budget.impl;

import com.ruoyi.common.core.text.Convert;
import com.ruoyi.domain.jpjs.common.budget.Basicprice;
import com.ruoyi.domain.jpjs.common.budget.Details;
import com.ruoyi.domain.jpjs.common.budget.Planbudget;
import com.ruoyi.mapper.jpjs.budget.BudgetPlanMapper;
import com.ruoyi.service.jpjs.budget.BudgetPlanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @author C.fw
 * @explain 混凝土报表业务层处理
 * @since 2020/8/15 15:43
 */
@Service
public class BudgetPlanServiceImpl implements BudgetPlanService {


    @Autowired
    private BudgetPlanMapper budgetPlanMapper;

    @Override
    public List<Basicprice> queryBasicPriceList(Map<String, Object> map) {
        return budgetPlanMapper.queryBasicPriceList(map);
    }

    @Override
    public List<Planbudget> queryBudgetList(Map<String, Object> map) {
        return budgetPlanMapper.queryBudgetList(map);
    }

    @Override
    public List<Details> queryDetailsList(Map<String, Object> map) {
        return budgetPlanMapper.queryDetailsList(map);
    }

    @Override
    public int insertBasicPrice(Basicprice basicprice) {
        return budgetPlanMapper.insertBasicPrice(basicprice);
    }

    @Override
    public int insertPlanBudgetBatches(List<Planbudget> planbudget) {
        return budgetPlanMapper.insertPlanBudgetBatches(planbudget);
    }

    @Override
    public int insertDetails(Details details) {
        return budgetPlanMapper.insertDetails(details);
    }

    @Override
    public int updateBasicPrice(Basicprice basicprice) {
        return budgetPlanMapper.updateBasicPrice(basicprice);
    }

    @Override
    public int updateBasicPriceFinish(Basicprice basicprice) {
        return budgetPlanMapper.updateBasicPriceFinish(basicprice);
    }

//    @Override
//    public int updatePlanBudget(Planbudget planbudget) {
//        return budgetPlanMapper.updatePlanBudget(planbudget);
//    }

    @Override
    public int updateDetails(Details details) {
        return budgetPlanMapper.updateDetails(details);
    }

    @Override
    public int deleteBasicPrice(String basicIdArr) {
        String[] basicId = Convert.toStrArray(basicIdArr);
        return budgetPlanMapper.deleteBasicPrice(basicId);
    }

    @Override
    public int deletePlanBudget(String planIdArr) {
        String[] planId = Convert.toStrArray(planIdArr);
        return budgetPlanMapper.deletePlanBudget(planId);
    }

    @Override
    public int deleteQuarterDetails(String detailIdArr) {
        String[] detailId = Convert.toStrArray(detailIdArr);
        return budgetPlanMapper.deleteQuarterDetails(detailId);
    }

    @Override
    public String queryCompanyNameById(String companyId) {
        return budgetPlanMapper.queryCompanyNameById(companyId);
    }

    @Override
    public int updatePlanBudgetBatches(List<Planbudget> planbudget) {
        return budgetPlanMapper.updatePlanBudgetBatches(planbudget);
    }
}
